package com.zw.cloud.mybatis.plus.enums;

import com.google.common.collect.Lists;
import lombok.Getter;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

/**
 * 可优化工艺枚举
 */
@Getter
public enum OptimizeCraftEnum {
    SPEED("车速","speed","speed","speed"),
    DRYING_ROOM_TEMP("总温度","dryingRoomTemp","dryingRoomTemp","dryingRoomPresetTemp"),
    FAN_SPEED("循环风","fanSpeed","fanSpeed","fanSpeed"),
    CIRCULATING_AIR_UPPER("循环风(上)","circulatingAirUpper","circulatingAirUpper","circulatingAirUpper"),
    CIRCULATING_AIR_LOWER("循环风(下)","circulatingAirLower","circulatingAirLower","circulatingAirLower"),
    TOTAL_AMPLITUDE("门幅","totalAmplitude","totalAmplitude","totalAmplitude"),
    TOP_FEED("上超喂","topFeed","topFeed","topFeed"),
    LOWER_FEED("下超喂","lowerFeed","lowerFeed","lowerFeed"),
    BRUSH_FEED("毛刷超喂","brushFeed","brushFeed","brushFeed"),
    UPPER_DOOR_WIDTH("上机门幅","upperDoorWidth","upperDoorWidth","upperDoorWidth"),
    LANDING_DOOR_WIDTH("落机门幅","landingDoorWidth","landingDoorWidth","lowerDoorWidth"),
    REDUCTION_AMPLITUDE("还原门幅","reductionAmplitude","reductionAmplitude","reductionAmplitude"),
    WASHING_REAR_DOOR_WIDTH("洗后门幅","washingRearDoorWidth","washingRearDoorWidth","washingRearDoorWidth"),
    SCHEDULE_PRE_WEIGHT("定前克重","schedulePreWeight","schedulePreWeight","preWeight"),
    SCHEDULE_GRAM_HEFT("定后克重","scheduleGramHeft","scheduleGramHeft","gramHeft"),
    REDUCTION_WEIGHT("还原克重","reductionWeight","reductionWeight","reductionWeight"),
    WEIGHT_AFTER_WASHING("洗后克重","weightAfterWashing","weightAfterWashing","weightAfterWashing"),
    LON("经度","lon","lon","lon"),
    LAT("纬度","lat","lat","lat"),
    CRAFT_SHRINKAGE("缩率","craftShrinkage","craftShrinkage","craftShrinkage"),
    UPPER_SCHEDULE_WEFT_DENSITY("上机纬密","upperScheduleWeftDensity","upperScheduleWeftDensity","upperWeftDensity"),
    UPPER_WARP_DENSITY("上机经密","upperWarpDensity","upperWarpDensity","upperWarpDensity"),
    SCHEDULE_WEFT_DENSITY("下机纬密","scheduleWeftDensity","scheduleWeftDensity","weftDensity"),
    LOWER_WARP_DENSITY("下机经密","lowerWarpDensity","lowerWarpDensity","lowerWarpDensity"),

            ;
    private String desc;
    private String baseShapingParamName;
    private String craftParamName;
    @Deprecated
    private String productParamName;



    OptimizeCraftEnum(String desc, String baseShapingParamName, String craftParamName, String productParamName) {
        this.desc = desc;
        this.baseShapingParamName = baseShapingParamName;
        this.craftParamName = craftParamName;
        this.productParamName = productParamName;
    }

    public static List<OptimizeCraftEnum> getOptimizeCraftEnum(Set<String> baseShapingParamConfigDTOList) {
        if (CollectionUtils.isEmpty(baseShapingParamConfigDTOList)) {
            return Lists.newArrayList();
        }
        List<OptimizeCraftEnum> optimizeCraftEnumList = new ArrayList<>(baseShapingParamConfigDTOList.size());
        for (OptimizeCraftEnum value : OptimizeCraftEnum.values()) {
            if (baseShapingParamConfigDTOList.contains(value.baseShapingParamName)) {
                optimizeCraftEnumList.add(value);
            }
        }
        return optimizeCraftEnumList;
    }

    public static void main(String[] args) {
        for (OptimizeCraftEnum value : OptimizeCraftEnum.values()) {
            System.out.println("/**\n" +
                    "     * "+value.desc+"\n" +
                    "     */\n" +
                    "    private BigDecimal "+value.craftParamName+";");
        }

    }
}
